﻿using Redis实战.Models;

namespace Redis实战.Interface
{
    public interface IUserRepository
    {
        Task<User?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
        Task UpdateAsync(User user, CancellationToken cancellationToken = default);
        Task CreateAsync(User user, CancellationToken cancellationToken = default);
        Task DeleteAsync(int id, CancellationToken cancellationToken=default);
        // 新增：清除用户缓存的方法
        Task RemoveUserCacheAsync(int id);
    }
}
